package com.qf.controller;

import com.qf.entity.TbPaper;
import com.qf.service.TbPaperService;
import com.qf.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.annotation.MultipartConfig;

/**
 * @author 10202
 * @version V1.0
 * @Project management-system
 * @Package com.qf.controller
 * @Date 2023/5/21 10:36
 */
@RestController
@RequestMapping("paper")
@MultipartConfig
public class PaperController {
    private final TbPaperService tbPaperService;

    public PaperController(TbPaperService tbPaperService) {
        this.tbPaperService = tbPaperService;
    }

    @GetMapping("/replyDetail")
    public Result replyDetailByStudentId(@RequestParam Long sid){
        return tbPaperService.replyDetailByStudentId(sid);
    }

    @GetMapping("/commit")
    public Result commit(@RequestParam Long sid){
        return tbPaperService.commit(sid);
    }
}
